<html><head><title>Developing With Soot in Eclipse</title></head>
<body background="background6.gif" TEXT="#000000" BGCOLOR="#F3F3F3" LINK="#0000CC">

<table cellspacing="3" cellpadding="0" border="0">

<tbody><tr>

<!--LeftHandTable-->

<td width="160" rowspace="1" valign="top" align="left">

<p>
<p><font face="helvetica,arial" size="+1"><b>Soot Home</b></font>

<p>
<a href="#creating"><font face="helvetica,arial" size="+0">Create Project</font></a><br>
<a href="#importing"><font face="helvetica,arial" size="+0">Import Sources</font></a><br>
<a href="#recognize"><font face="helvetica,arial" size="+0">Recognize Sources</font></a><br>
<a href="#lib"><font face="helvetica,arial" size="+0">Setup Libraries</font></a><br>
<a href="#building"><font face="helvetica,arial" size="+0">Building</font></a><br>
<a href="#running"><font face="helvetica,arial" size="+0">Running</font></a><br>

<p><a href="http://www.sable.mcgill.ca">Sable Home</a>
<p><a href="index.html">Soot Home</a>


<!--ActualContents-->

</p></td><td valign="top" align="left">


<h3><center>Developing With Soot in Eclipse</center></h3>

<a name="creating"><h5>Step 1: Creating a Project</h5></a>
<ul>
<li>Start Eclipse
<li>Select <tt>File </tt>-- <tt>New</tt> -- <tt>Project</tt>
<li>Select <tt>Java</tt> and <tt>Java Project</tt>
<li>Click <tt>Next</tt>
<br><br>
<li>Give a name to the project
<li>Click <tt>Next</tt>
<li>Click <tt>Finish</tt>
</ul>
<p>You should now have an empty project.</p>

<a name="importing"><h5>Step 2: Importing the Soot Source Files</h5></a>
<ul>
<li>Right click on your project and select <tt>Import</tt>
<li>Select <tt>File System</tt>
<li>Click <tt>Next</tt>
<li>Use <tt>Browse</tt> to find your Soot source files
<li>Select the Soot package root directory to import
<li>Click <tt>Finish</tt>
</ul>
<p>You should now have the regular Soot source files in a src directory in your project.</p>

<p>You also need to import the generated src files. Make sure you have these
built first. (They come built - but if you used ant veryclean at some point you may have deleted them.)</p>

<ul>
<li>Right click on your project and select <tt>Import</tt>
<li>Select <tt>File System</tt>
<li>Click <tt>Next</tt>
<li>Use browse to find the generated Soot sources directories.
<li>Select the generated/options generated/singletons and generated/sablecc directories.
<li>Click <tt>Finish</tt>
</ul>

<a name="recognize"><h5>Step 3: Making Eclipse Recognize Source Files</h5></a>

<p>Now you need to make Eclipse recognize these directories as src directories.</p>

<ul>
<li>Right click on your project
<li>Select <tt>Properties</tt>
<li>From the tree on the right select <tt>Java Build Path</tt>
<li>Pick the <tt>Source</tt> tab
<li>Select <tt>Add Folder</tt>
<li>Select your project src folder
<li>Click <tt>Ok</tt>
<li>Repeat for each of the generated folders
</ul>

<a name="lib"><h5>Step 4: Adding libraries needed by Soot</h5></a>
<p>Now you need to add the Jasmin, Polyglot and Ant libraries, and the Soot classes, to your project.</p>

<ul>
<li>Right click on your project
<li>Select <tt>Properties</tt>
<li>From the tree on the right select <tt>Java Build Path</tt>
<li>Select the <tt>Libraries</tt> tab
<li>Select <tt>Add External Jars</tt> 
<li>Use the dialog to select your jasminclasses.jar file
<li>Click <tt>OK</tt>
<li>Repeat for your polyglotclasses.jar file and ant.jar file
<li>Select <tt>Add Class Folder</tt> and choose the "classes" folder to add the Soot classes</li>
<li>Click <tt>OK</tt> again
</ul>

<a name="building"><h5>Step 5: Building your project</h5></a>

<ul>
<li>Select your project
<li>Select <tt>Project</tt> -- <tt>Build Project</tt>
</ul>

<p>Your project should compile with no problems but there will be lots
of warnings. You can ignore these. They are mostly for unused imports.</p>

<a name="running"><h5>Step 6: Running your project</h5></a>
<ul>
<li>Select <tt>Run</tt> -- <tt>Run ...</tt> or <tt>Debug ...</tt>
<li>Select <tt>Java Application</tt>
<li>Select <tt>New</tt>
<li>Use search to find the main class to run
<li>Set arguments under the <tt>Argument</tt> tab
</ul>

</td></tr></tbody></table>
</body></html>
